export default {
    //存储token
	insertTokenStorage(value) {
		sessionStorage.setItem("tokenx", JSON.stringify(value));
		return;
	},
    //获取token
	getTokenStorage() {
		const value = JSON.parse(sessionStorage.getItem("tokenx"));
		if (value === undefined || value === null || value === '') {
			return 'error'
		}
		return value;
	},
	//存储用户ID
	insertAxiosUserIdStorage(value) {
		sessionStorage.setItem("comploId", JSON.stringify(value));
		return;
	},

	

	//请求头获取用户ID
	getAxiosUserId() {
		const value = JSON.parse(sessionStorage.getItem("comploId"));
		if (value === undefined || value === null || value === '') {
			return 'error'
		}
		return value;
	},

	//存入角色ID
	insertroleId(value){
		sessionStorage.setItem("roleId", JSON.stringify(value));
	},
	

	//获取角色ID
	getroleId(){
		const value = JSON.parse(sessionStorage.getItem("roleId"));
		if (value === undefined || value === null || value === '') {
			return 'error'
		}
		return value;
	},


	//用户退出登录清空Storage
	flushUser() {
		sessionStorage.removeItem("comploId");
		sessionStorage.removeItem("tokenx");
		sessionStorage.removeItem("roleId");
	}
}